<?php

require_once( '../../conf/conf.inc' );
require_once( PATH_FRAME.'/etwork.php' );

$etw = new etwork;
$etw->parseURL('edit/api', 2);

$etw->limitLevel = access::MEMBER;
$etw->isEdit = true;

$etw->setTemplate( 'api', true, true );
$etw->setTemplateGroup('index');

if (! isset($etw->pathParameters[0]) ) {

} else if ($etw->pathParameters[0] == 'hito') {

    $etw->setTemplateGroup('index');

    $etw->noCaching = true;

    $loader = new modelLoader;
    $loader->model = 'hito';
    $loader->order = @$etw->EX_GET['r'] ? $etw->EX_GET['r'] : '_update_date';
    $loader->alike = @$etw->EX_GET['s'];
    $loader->limit = 50;
    $loader->mapperParameters = array(
        'without' => @$etw->EX_GET['m']
    );
    $loader->returning = 'list';
    $etw->addLoader($loader);

    $etw->loadData();

} else if ($etw->pathParameters[0] == 'item') {

    $etw->setTemplateGroup('index');

    $etw->noCaching = true;

    $loader = new modelLoader;
    $loader->model = 'item';
    $loader->order = @$etw->EX_GET['r'] ? $etw->EX_GET['r'] : '_update_date';
    $loader->alike = @$etw->EX_GET['s'];
    $loader->limit = 50;
    $loader->mapperParameters = array(
        'without' => @$etw->EX_GET['m']
    );
    $loader->returning = 'list';
    $etw->addLoader($loader);

    $etw->loadData();

}

$etw->showFinal();


